Last-Update: 2014-07-02
Author: Julian Taylor <jtaylor@ubuntu.com>
Bug-Debian: http://bugs.debian.org/656795
Bug-Debian: http://bugs.debian.org/705127
Forwarded: no
Description: fix build with "ld --as-needed", without required "-lm".
 libraries must be behind objects (including static libraries)

--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -7,11 +7,11 @@
 	-DG_LOG_DOMAIN=\"Planner\"			\
 	-DEXAMPLESDIR=\"$(top_srcdir)/tests/files\"
 
 LDADD =	\
+	$(PLANNER_LIBS) \
 	$(top_builddir)/src/libplannerapp.la \
-	$(top_builddir)/libplanner/libplanner-1.la \
-	$(PLANNER_LIBS)
+	$(top_builddir)/libplanner/libplanner-1.la
 
 check_LTLIBRARIES = libselfcheck.la
 
 libselfcheck_la_SOURCES =                              \
@@ -20,21 +20,21 @@
 
 check_PROGRAMS = $(TESTS)
 
 scheduler_test_SOURCES = scheduler-test.c
-scheduler_test_LDADD = $(LDADD) libselfcheck.la
+scheduler_test_LDADD = libselfcheck.la $(LDADD)
 
 time_test_SOURCES = time-test.c
-time_test_LDADD = $(LDADD) libselfcheck.la
+time_test_LDADD = libselfcheck.la $(LDADD)
 
 calendar_test_SOURCES = calendar-test.c
-calendar_test_LDADD = $(LDADD) libselfcheck.la
+calendar_test_LDADD = libselfcheck.la $(LDADD)
 
 task_test_SOURCES = task-test.c
-task_test_LDADD = $(LDADD) libselfcheck.la
+task_test_LDADD = libselfcheck.la $(LDADD)
 
 cmd_manager_test_SOURCES = cmd-manager-test.c
-cmd_manager_test_LDADD = $(LDADD) libselfcheck.la
+cmd_manager_test_LDADD = libselfcheck.la $(LDADD)
 
 TESTS_ENVIRONMENT = \
 	PLANNER_STORAGEMODULEDIR=$(top_builddir)/libplanner/.libs \
 	PLANNER_FILEMODULESDIR=$(top_builddir)/libplanner/.libs \
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -20,9 +20,9 @@
 planner_LDFLAGS = -export-dynamic
 planner_LDADD = \
 	libplannerapp.la \
 	$(top_builddir)/libplanner/libplanner-1.la \
-	$(PLANNER_LIBS)
+	$(PLANNER_LIBS) -lm
 
 
 # Create a convenience library to link our tests against
 noinst_LTLIBRARIES = libplannerapp.la
